package com.ifugle.rap.application.service;

import java.util.List;
import javax.websocket.OnMessage;
import com.ifugle.rap.application.api.UserPetApi;
import com.ifugle.rap.application.api.UserPlaneApi;
import com.ifugle.rap.application.mapper.UserPlaneMapper;
import com.ifugle.rap.application.model.UserPlane;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class UserPlaneService implements UserPlaneApi {

    @Autowired
    UserPlaneMapper userPlaneMapper;


    @Override
    public int deleteByPrimaryKey(Long id) {
        return userPlaneMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int insert(UserPlane record) {
        return userPlaneMapper.insert(record);
    }

    @Override
    public int insertSelective(UserPlane record) {
        return userPlaneMapper.insertSelective(record);
    }

    @Override
    public UserPlane selectByPrimaryKey(Long id) {
        return userPlaneMapper.selectByPrimaryKey(id);
    }

    @Override
    public List<UserPlane> selectByUserId(Long useId) {
        return userPlaneMapper.selectByUserId(useId);
    }

    @Override
    public int updateByPrimaryKeySelective(UserPlane record) {
        return userPlaneMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(UserPlane record) {
        return userPlaneMapper.updateByPrimaryKey(record);
    }

    @Override
    public int updateByUserIdAndPlaneId(UserPlane record){
        return userPlaneMapper.updateByUserIdAndPlaneId(record);
    }

    @Override
    public UserPlane selectByUserIdAndPlaneId(Long userId, Long planeId) {
        return userPlaneMapper.selectByUserIdAndPlaneId(userId,planeId);
    }

    @Override
    public int updateByUserId(Long userId) {
        return userPlaneMapper.updateByUserId(userId);
    }

    @Override
    public UserPlane selectEnableByUserId(Long userId) {
        return userPlaneMapper.selectEnableByUserId(userId);
    }
}
